<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            width: 100%;
            height: 1000px;
            border: 1px solid red;
            background-color: red;
            /* background: url(./2.png);
            background-repeat: no-repeat;
            background-position: center;
            background-attachment: fixed; */
            background: url(./2.png) no-repeat center fixed;
        }
        /* 
            background 背景属性的简写
            可以设置背景颜色、图片、是否重复、位置、是否固定显示
        */
        div {
            width: 200px;
            height: 200px;
            border: 1px solid red;
            /* background-color: red;
            background: url(./2.png);
            background-repeat: no-repeat;
            background-position: center;
            background-attachment: fixed; */
            /* background: url(./2.png) repeat-x center 10px; */
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>